
#ifndef __PENDING_DB_H
#define __PENDING_DB_H

#include <vector>
#include "../crypt/KeyPair.h"
#include "SQLiteDB.h"

// handle char(64)
// keydata char(4096)

class PendingDB : public SQLiteDB
{
   public:
      PendingDB(const char *filename) : SQLiteDB(filename, 1) { CreateTablesIfNecessary(); }
      ~PendingDB();
      std::vector<char *> *GetAllPendingUserRequests();
      void RemovePendingUserRequest(const char *name);
      void AddNewUserRequest(const char *usename, const char *host, const char *date, const char *publickey, const char *contactkey);
      std::vector<char *> *GetAllPendingHostKeyUpdates();
      void RemovePendingHostKeyUpdate(const char *hostname);
      void AddNewHostKeyUpdateRequest(const char *hostname, const char *oldkeyfingerprint, const char *newkeyfingerprint);
      void CreateTablesIfNecessary();
};

#endif
